/***************************************************************
*  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
*  All rights reserved.
*
*  This file is part of the GroupMe! Project. Source code of 
*  this project is closed and redistribution of this code is
*  prohibited. 
*  
*  Contact: http://www.groupme.net
*
*  This copyright notice MUST APPEAR in all copies of the file!
***************************************************************/
package net.groupme.search.strategy;

import java.util.Collection;
import java.util.List;

import net.groupme.model.Group;
import net.groupme.model.Resource;
import net.groupme.model.Tag;

/**
 * created on Jul 3, 2007
 * 
 * This interface defines methods that should be offered by the different 
 * interenal GroupMe search strategies.
 * 
 * @author Fabian Abel, <a href="mailto:abel@l3s.de">abel@l3s.de</a>
 * @author last edited by: $Author: fabian $
 * 
 * @version $Revision: 1.2 $ $Date: 2007-07-05 16:49:36 $
 */
public interface SearchStrategy {

	/**
	 * This method searches for groups that are tagged with the given tags. Furthermore, groups
	 * that are not tagged with the given tags, but which are related in another way (<i>meaning of
	 * relation depends on the concrete strategy</i>) may be returned either.
	 * 
	 * @param tags the tags to search with
	 * @param allTags indicates wheater all tags have to be related with a resulting group (<code>true</code>)
	 * or only any of the given tags (<code>false</code>)
	 * @return an ordered list of suiting {@link Group} instances
	 */
	public List<Group> searchForGroups(Collection<Tag> tags, boolean allTags);
	
	/**
	 * This method searches for resources that are tagged with the given tags. Furthermore, resources
	 * that are not tagged with the given tags, but which are related in another way (<i>meaning of
	 * relation depends on the concrete strategy</i>) may be returned either.
	 * 
	 * @param tag the tags to search with
	 * @param allTags indicates wheater all tags have to be related with a resulting group (<code>true</code>)
	 * or only any of the given tags (<code>false</code>)
	 * @param noGroups as {@link Group} instances are also {@link Resource} one can explicitly exclude {@link Group} instances by
	 * if this parameter is <code>false</code>
	 * @return an ordered list of suiting {@link Group} instances
	 */
	public List<Resource> searchForResources(Collection<Tag> tags,  boolean allTags, boolean noGroups);
}
